import { action } from 'mobx'
import Toast from 'components/toast'
import copy from 'copy-to-clipboard'

export default class SaleNecessaryVM {
  constructor (props) {
    this.props = props
    this.PageInitialization()
  }

  // 在线浏览
  @action handleInlineLook = (v) => {
    switch (v) {
      case 1:
        this.props.history.push('/pdfFile1')
        break
      case 2:
        this.props.history.push('/pdfFile2')
        break
      case 3:
        this.props.history.push('/pdfFile3')
        break
    }
  }

  // 复制链接
  @action handleCopyLink = (v) => {
    switch (v) {
      case 1:
        Toast.success('复制成功')
        copy('https://wzweb.shundaonetwork.com/玖里产品简介.pdf')
        break
      case 2:
        Toast.success('复制成功')
        copy('https://wzweb.shundaonetwork.com/玖里产品采购合同.pdf')
        break
      case 3:
        Toast.success('复制成功')
        copy('https://wzweb.shundaonetwork.com/玖里平台服务合同.pdf')
        break
    }
  }
  @action PageInitialization = async () => {
  }
}
